package com.ly.mpayment.rest.up.qinghaiyd;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.linkage.securer.authen.util.AccountPasswordUtil;
import com.ly.mpayment.core.util.*;
import com.ly.mpayment.persist.entity.Mobile;
import com.ly.mpayment.persist.entity.UpOrder;
import com.ly.mpayment.persist.entity.UpShopInfo;
import com.ly.mpayment.persist.service.downrechargeflow.IDownRechargeFlowService;
import com.ly.mpayment.persist.service.downshopinfo.IDownShopInfoService;
import com.ly.mpayment.persist.service.mobile.IMobileService;
import com.ly.mpayment.persist.service.uporder.IUporderService;
import com.ly.mpayment.persist.service.upshopinfo.IUpShopInfoService;
import com.ly.mpayment.rest.recharge.OrderProcessing;
import com.ly.mpayment.rest.recharge.RechargeRest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author luoyang
 * @date 2020/9/3 9:12
 *     QHAI_UNHQ_checkCustManager 第三方话费慢充前校验接口
 *     QHAI_UNHQ_queryGrpTransInfoByGrpId 第三方集团用户话费慢充订购信息查询接口
 *     QHAI_UNHT_createTransFeeForGrpMem 第三方话费慢充接口
 *
 */
@Component
@Path("qinghaiyidong")
public class QingHaiYd {

    Logger logger = Logger.getLogger(QingHaiYd.class);

    @Autowired
    IUporderService upOrderService;

    @Autowired
    private ThreadPoolTaskExecutor taskExecutor;

    @Autowired
    IDownRechargeFlowService flowService;

    @Autowired
    IDownShopInfoService shopService;

    @Autowired
    IUpShopInfoService upShopInfoService;

    @Autowired
    IMobileService mobileService;

    /**
     * 提交订单
     * @param order
     * @param shop
     */
    public void commitOrder(UpOrder order, UpShopInfo shop) {

        //查询号码地市
        final Mobile mobile = mobileService.findPhone(order.getUpphonenum().substring(0, 7));
        if(mobile == null || StringUtils.isBlank(mobile.getCityCode())){
            //不支持的号段
            logger.info("不支持的号段:"+order.getUpphonenum());
            order.setRemark("不支持的号段");
            RechargeRest.failtUpOrder.add(order);
        }else{
            //充值前效验
            JSONObject resultCheck = null;
            try {
                resultCheck = this.checkCustManager(order.getUporderuuid(),order.getUpShopPro().getProductCode(),order.getUpphonenum(),
                        shop.getOrderCommitAddress(),shop.getUpkey(),shop.getAppId(),mobile);
                //认证ok
                if(resultCheck != null && resultCheck.getString("respCode").equals("0")){

                    if(resultCheck.getJSONObject("result") != null && resultCheck.getJSONObject("result").getString("SVC_CONTENT") != null){
                        //解密
                        resultCheck = JSONObject.parseArray(this.decryp(resultCheck.getJSONObject("result").getString("SVC_CONTENT"))).getJSONObject(0);
                        logger.info("resultCheck:"+resultCheck+","+order.getUpphonenum());
                        YiDongEntity yiDongEntity = new YiDongEntity();
                        yiDongEntity.setOrderId(order.getUporderuuid());
                        yiDongEntity.setMobile(mobile);
                        yiDongEntity.setPhone(order.getUpphonenum());
                        yiDongEntity.setStatus(0);
                        yiDongEntity.setResultCheck(resultCheck);
                        yiDongEntity.setShop(shop);
                        OrderProcessing.yiDongQueue.add(yiDongEntity);
                        logger.info("添加到下单:"+yiDongEntity.getPhone());
                        //{"X_RECORDNUM":"1","X_PAGINCURRENT":"0","VALIDATE_CODE":"745191","X_RSPDESC":"OK","X_RSPTYPE":"0","aop_srv":"aopesb14","SYS_DATE":"",
                        // "USER_ID":"","X_RSPCODE":"0000","VALIDATE_FLOW_ID":"2022030121594436463969","SERIAL_NUMBER":"","X_NODENAME":"svc-node01-crm-fuse01",
                        // "X_RESULTSIZE":"1","X_RESULTCOUNT":"1","X_PAGINCOUNT":"0","X_RESULTCODE":"0","X_PAGINSIZE":"0","X_RESULTINFO":"OK"}
                    }else{
                        logger.info("认证失败:"+order.getUpphonenum());
                        order.setRemark(resultCheck.getString("respDesc"));
                        RechargeRest.failtUpOrder.add(order);
                    }
                }else{
                    order.setRemark(resultCheck != null ?
                            resultCheck.getString("respDesc") : "效验超时");
                    RechargeRest.failtUpOrder.add(order);
                }
            } catch (Exception e) {
                e.printStackTrace();
                logger.info(e.getMessage());
                logger.info("签名错误:"+order.getUpphonenum());
                upOrderService.updateUpOrderMsg(order,  "","解密失败:充值效验");
                //RechargeRest.failtUpOrder.put(order.getUporderuuid(),"订单失败");
                //flowService.orderHanlderFailt(order, upOrderService, flowService, shopService, taskExecutor, "订单失败");
            }
        }
    }

    public void rechargeYidong(YiDongEntity yiDongEntity,UpOrder upOrder){
        try{
            final JSONObject group = queryGrpTransInfoByGrpId(upOrder.getUporderuuid(),upOrder.getUpShopPro().getProductCode(),
                    yiDongEntity.getShop().getOrderCommitAddress(),yiDongEntity.getShop().getAppId(),yiDongEntity.getShop().getUpkey(),
                    yiDongEntity.getMobile(),upOrder.getUpphonenum());
            if(group != null && group.getString("respCode").equals("0") && group.getJSONObject("result") != null &&
                    group.getJSONObject("result").getString("SVC_CONTENT") != null ){
                //解密
                final JSONObject groupResult = JSONObject.parseArray(this.decryp(group.getJSONObject("result").getString("SVC_CONTENT"))).getJSONObject(0);
                logger.info("groupResult:"+groupResult+","+upOrder.getUpphonenum());
                //:{"X_RECORDNUM":"1","RSP_DESC":"success","GRP_SERIAL_NUMBER":"07100047372407016","X_PAGINCURRENT":"0","X_RSPDESC":"OK","X_RSPTYPE":"0","aop_srv":"aopesb1",
                // "END_DATE":"2050-12-31 23:59:59","START_DATE":"2020-11-24 10:04:28","X_RSPCODE":"0000","GROUP_ID":"7100047372",
                // "GROUP_NAME":"青**航网络科技有限公司","X_NODENAME":"svc-node01-crm-fuse01","X_RESULTSIZE":"1","X_RESULTCOUNT":"1",
                // "X_PAGINCOUNT":"0","GRP_USER_ID":"7120112420945002","X_RESULTCODE":"0","FEE_INFO":[{"DEPOSIT_CODE":"20","DEPOSIT_FEE":"77708600",
                // "DEPOSIT_NAME":"特殊预存话费存折"}],"RSP_CODE":"0000","X_PAGINSIZE":"0","X_RESULTINFO":"OK"}
                if(groupResult != null && groupResult.containsKey("RSP_DESC")
                        && groupResult.getString("RSP_DESC").equals("success")
                        && groupResult.containsKey("GRP_USER_ID")
                        && groupResult.containsKey("RSP_CODE")
                        && groupResult.getString("RSP_CODE").equals("0000") ){
                    yiDongEntity.setGroupResult(groupResult);
                    OrderProcessing.yiDongQueuePlace.add(yiDongEntity);
                    logger.info("添加到充值:"+yiDongEntity.getPhone());
                }else{
                    logger.info("订购信息查询失败:"+upOrder.getUpphonenum());
                    upOrder.setRemark(group != null ?
                            group.getString("respDesc") : "超时");
                    RechargeRest.failtUpOrder.add(upOrder);
                }
            }else{
                logger.info("订购信息查询失败:"+upOrder.getUpphonenum());
                upOrder.setRemark(group != null ?
                        group.getString("respDesc") : "订购信息查询超时");
                RechargeRest.failtUpOrder.add(upOrder);
            }
        }catch(Exception e){
            logger.info(e.getMessage());
            upOrderService.updateUpOrderMsg(upOrder,  "","解密失败:订购信息查询");
        }
    }

    public void placeOrder(YiDongEntity yiDongEntity,UpOrder upOrder) throws Exception {
        final JSONObject publicParamters = publicParamters("QHAI_UNHT_KeysCreateTransFeeForGrpMem",
                yiDongEntity.getShop().getAppId(),upOrder.getUporderuuid(), upOrder.getUpShopPro().getProductCode(),
                yiDongEntity.getShop().getUpkey(),yiDongEntity.getMobile());
        logger.info("publicParamters:{}"+publicParamters.toString()+","+upOrder.getUpphonenum());
        JSONObject params = new JSONObject();

        JSONObject content = new JSONObject();
        //        VALIDATE_FLOW_ID	String		1	校验流水	校验接口返回
        //        VALIDATE_CODE	String		1	验证码	校验接口返回
        //        GRP_USER_ID	String		1	集团用户编码	集团用户话费慢充订购信息查询接口返回
        //        SERIAL_NUMBER	String		1	手机号码	青海移动在网号码
        //        TRANS_FEE	String		1	话费金额	元
        //        DEPOSIT_CODE	String		1	存折编码	转出用户的存折编码，集团用户话费慢充订购信息查询接口返回
        //        IS_NEED_SMS	String		?	是否下发通知短信	0-不发送 1-发送，默认为0
        content.put("VALIDATE_FLOW_ID",yiDongEntity.getResultCheck().getString("VALIDATE_FLOW_ID"));
        content.put("VALIDATE_CODE", yiDongEntity.getResultCheck().getString("VALIDATE_CODE"));
        content.put("GRP_USER_ID", yiDongEntity.getGroupResult().getString("GRP_USER_ID"));
        content.put("SERIAL_NUMBER",upOrder.getUpphonenum());
        content.put("TRANS_FEE",upOrder.getUpShopPro().getUpfacevalue());
        //"FEE_INFO":[{"DEPOSIT_CODE":"20","DEPOSIT_NAME":"特殊预存话费存折","DEPOSIT_FEE":"50000000"}]
        content.put("DEPOSIT_CODE",yiDongEntity.getGroupResult().getJSONArray("FEE_INFO").getJSONObject(0).getString("DEPOSIT_CODE"));
        content.put("IS_NEED_SMS","1");

        //publicParamters.put("content",JSONObject.toJSONString(content));
        //logger.info("shop:{}"+shop.getOrderCommitAddress());
        final String url = yiDongEntity.getShop().getOrderCommitAddress().concat("?").concat(StringSort.jsonToString(publicParamters));
        logger.info(url+content.toString());
        params.put("params",this.encryp(content.toString()));
        String result = HttpClient.post(url,params.toString());
        logger.info("QHAI_UNHT_createTransFeeForGrpMem:{}"+result+","+upOrder.getUpphonenum());
        if(result != null ){
            JSONObject json = JSONObject.parseObject(result);
            if(json != null && !json.getString("respCode").equals("null") && json.getString("respCode").equals("0") && json.getJSONObject("result") != null &&
                    json.getJSONObject("result").getString("SVC_CONTENT")!= null ){
                JSONObject success = null;
                try{
                    final String resStr = this.decryp(json.getJSONObject("result").getString("SVC_CONTENT"));
                    //[{"BIZ_CODE":"","BIZ_DESC":"","NEED_PAY":"","NEED_PRINT":"","ORDER_ID":"7122030169667244","ORDER_TYPE_CODE":"1118","ROUTE":"0971","TRADES":[{"ROUTE":"0971","TRADE_ID":"7122030119396000","TRADE_TYPE_CODE":"1118","USER_ID":"7115080132508232"}],"TRADE_ID":"7122030119396000","TRADE_TYPE_CODE":"1118","USER_ID":"7115080132508232","X_ISARRAY":"false","X_NODENAME":"svc-node01-crm-fuse01","X_PAGINCOUNT":"0","X_PAGINCURRENT":"0","X_PAGINSIZE":"0","X_RECORDNUM":"1","X_RESULTCODE":"0","X_RESULTCOUNT":"1","X_RESULTINFO":"OK","X_RESULTSIZE":"1","X_RSPCODE":"0000","X_RSPDESC":"OK","X_RSPTYPE":"0","aop_srv":"aopesb17"}]
                    logger.info("QHAI_UNHT_createTransFeeForGrpMem:"+resStr+",success:"+upOrder.getUpphonenum());
                    success = JSONObject.parseArray(resStr).getJSONObject(0);
                    logger.info("success:"+success+",success_phone:"+upOrder.getUpphonenum());
                    //{"CUST_ID":"7108121503033709","X_PAGINCURRENT":"0","IN_MODE_CODE":"k","X_RSPTYPE":"0","EPARCHY_CODE":"","USER_ID":"7100000711411430","STAFF_ID":"ITFHMC17","X_TRANS_CODE":"QHAI_UNHT_KeysCreateTransFeeForGrpMem","X_RSPCODE":"0000","X_CLIENT_IP":"","DEPART_CODE":"65228","X_NODENAME":"app-node04-srv07:bb3e913033d9448aa7df0bf337526007:1606230228568","X_MENU_ID":"","ROUND_AUDIT":"","STAFF_EPARCHY_CODE":"0971","X_RESULTCODE":"0","TRADE_ID":"7120112409308486","STAFF_NAME":"","X_RESULTINFO":"ok","DEPART_ID":"","X_RECORDNUM":"1","X_IBOSSMODE":"0","CITY_CODE":"","CHANNEL_TYPE_ID":"","ACCT_ID":"7108121503576897","SOURCE_NAME":"","X_RSPDESC":"ok","SUBSYS_CODE":"uiopserv","CUST_TYPE":"MEB","GROUP_ID":"7100047372","DB_SOURCE":"cg","ORDER_ID":"7120112430091224","X_RESULTSIZE":"1","MAIN_ID":"","X_RESULTCOUNT":"0","X_PAGINCOUNT":"0","DEPART_NAME":"","TRADE_TYPE_CODE":"1118","X_TRANSMODE":"0","X_PAGINSIZE":"0"}
                    if(!StringUtils.isBlank( success.getString("ORDER_ID"))){
                        upOrderService.updateUpOrderMsg(upOrder,  success.getString("ORDER_ID"),"订单成功");
                        UpOrder upOrderNew = this.upOrderService.findById(upOrder.getUporderuuid());
                        if(upOrderNew != null && success.containsKey("ORDER_ID")) {
                            if (upOrderNew != null && !StringUtils.isBlank(success.getString("ORDER_ID")) && upOrderNew.getStatus() == Config.status[0]) {
                                upOrder.setRemark(success.getString("ORDER_ID"));
                                RechargeRest.successUpOrder.add(upOrder);
                            }
                        }
                    } else if(!success.containsKey("ORDER_ID") && !success.containsKey("TRADE_ID")){
                        logger.info("failt:"+success+","+upOrder.getUpphonenum());
                        upOrder.setRemark("失败");
                        RechargeRest.failtUpOrder.add(upOrder);
                    }else{
                        upOrderService.updateUpOrderMsg(upOrder,  success.getString("ORDER_ID"),json.getString("respDesc"));
                    }
                }catch(Exception e){
                    e.printStackTrace();
                    logger.info(e.getMessage());
                    if(success != null && !StringUtils.isBlank(success.getString("ORDER_ID")) ){
                        upOrder.setRemark(success != null ? success.getString("ORDER_ID") : "");
                        RechargeRest.successUpOrder.add(upOrder);
                    }else{
                        logger.info("success_failt:"+success);
                        upOrderService.updateUpOrderMsg(upOrder,  "","解密失败:充值成功");
                    }
                    //flowService.orderHanlder(order, upOrderService, flowService, shopService, taskExecutor,success != null ? success.getString("ORDER_ID") : "");
                }
            }else if(json.getString("respCode").equals("CRM_GRP_713")
                    //json.getString("respCode").equals("40001") ||  不能失败可能充值成功
                    || json.getString("respCode").equals("CRM_COMM_982")
                    || json.getString("respCode").equals("CRM_BAT_COMM")
                    || json.getString("respCode").equals("CRM_COMM_103")
                    || json.getString("respCode").equals("20302")
                    || json.getString("respCode").equals("ROUTE_ERROR_MAPPING_USER")
                    || json.getString("respCode").equals("CRM_COMM_1")
                    || json.getString("respCode").equals("CRM_COMM_983")
                    || json.getString("respCode").equals("java.net.UnknownHostException")
                    || json.getString("respCode").equals(" ### Error querying database.  Cause")
                    || json.getString("respCode").equals("csf1045")
                    || json.getString("respCode").equals("java.lang.ClassCastException")
                    || json.getString("respCode").equals(" java.sql.SQLException")
                    || json.getString("respCode").equals("svc-node01-crm-fuse01")
                    || json.getString("respCode").equals("null")
                    || json.getString("respCode").equals("BUSINESS_DATA_NOT_FOUND")
            ){
                //{"respCode":"40001","respDesc":"入参解密后格式转换异常,请检查加密入参格式 CRM_COMM_983
                upOrder.setRemark(json.getString("respDesc"));
                RechargeRest.failtUpOrder.add(upOrder);
            }else{
                upOrderService.updateUpOrderMsg(upOrder,  "",json.getString("respDesc"));
            }
//                            13.	ORDER_ID	String			订单流水
//                            14.	TRADE_ID	String			台帐流水
        }else{
            upOrderService.updateUpOrderMsg(upOrder,  "","订单异常");
        }
    }

    /**
     * 查询
     * @param upOrder
     * @param shopInfo
     */
    public void queryOrder(UpOrder upOrder, UpShopInfo shopInfo) {
    }

    @Path("callBack")
    @GET
    public String callBack( ){
        return "";
    }

    /**
     * 2.1.1第三方话费慢充前校验接口
     * @param orderId
     * @param provincecode
     * @param phone
     * @param url
     */
    private JSONObject checkCustManager(String orderId,String provincecode,String phone,String url,String upkey,String appid, Mobile mobile) throws Exception {
        JSONObject publicParamters = publicParamters("QHAI_UNHQ_KeysCheckCustManager",appid,orderId,provincecode,upkey,mobile);
        JSONObject content = new JSONObject();
        JSONObject params = new JSONObject();
        content.put("GROUP_ID","7100047372");//集团客户编码
        content.put("SERIAL_NUMBER","13908033225");
        params.put("params",encryp(content.toString()));
        //publicParamters.put("content",JSONObject.toJSONString(content));
        url = url.concat("?").concat(StringSort.jsonToString(publicParamters));
        logger.info(url+content.toString());
        String result = HttpClient.post(url,params.toString());
        logger.info("checkCustManager:"+result+","+url+","+phone);
        if(result != null){
            return JSONObject.parseObject(result);
        }
//        {
//            "respCode": "0",
//                "respDesc": "TradeOK",
//                "result": {
//            "SVC_CONTENT": [
//            ]}}
//        VALIDATE_FLOW_ID	String			校验流水	做话费慢充的时候需要传给boss校验时效性
//        VALIDATE_CODE	String			验证码	做话费慢充的时候需要传给boss校验失效性
        return null;
    }

    /**
     * 第三方集团用户话费慢充订购信息查询接口
     * @param orderId
     * @param provincecode
     * @param url
     */
    private JSONObject queryGrpTransInfoByGrpId(String orderId,String provincecode,String url,String appId,String upKey,Mobile mobile,String phone) throws Exception {
        JSONObject publicParamters = publicParamters("QHAI_UNHQ_KeysQueryGrpTransInfoByGrpId",appId,orderId,provincecode,upKey,mobile);
        JSONObject content = new JSONObject();
        JSONObject params = new JSONObject();
        content.put("GROUP_ID","7100047372");//集团客户编码
        params.put("params",encryp(content.toString()));
        url = url.concat("?").concat(StringSort.jsonToString(publicParamters));
        logger.info(url);
        String result = HttpClient.post(url,params.toString());
        logger.info("queryGrpTransInfoByGrpId:{}"+result+","+phone);
        if(result != null){
            return JSONObject.parseObject(result);
        }

//        GROUP_ID	String			集团编码
//        GROUP_NAME	String			集团名称
//        GRP_USER_ID	String			集团产品用户ID
//        GRP_SERIAL_NUMBER	String			集团产品用户号码
//        START_DATE	String			集团产品开始时间
//        END_DATE	String			集团产品截止时间
//        FEE_INFO		*		集团用户话费信息
//        DEPOSIT_CODE	String		FEE_INFO	存折编码
//        DEPOSIT_NAME	String		FEE_INFO	存折名称
//        DEPOSIT_FEE	String		FEE_INFO	存折余额
        return null;
    }
    //private String version = "";


    private JSONObject publicParamters(String method,String appId,String orderId,String provincecode,String apikey,Mobile mobile){
        JSONObject parames = new JSONObject();

        parames.put("method",method);
        parames.put("timestamp", new DateUtils().toTimeStamp());
        parames.put("format","json");
        parames.put("appId",appId);
        //parames.put("version",version);
        parames.put("Status",1);
        parames.put("flowId",orderId);//渠道唯一流水（32位以内，渠道确保内部唯一即可）
        parames.put("provincecode",971);//省别编码
        parames.put("inmodecode","k");//接入方式  k
        //按号码地市传入
        parames.put("tradeeparchycode","0971");//员工所在地州编码，对于省集中的省份，填写“INTF。地州编码
        //按号码地市
        parames.put("tradecitycode",mobile.getCityCode());//员工所在业务区编码。业务区编码
        parames.put("tradedepartid","65228");//员工所在的部门
        parames.put("staffid","ITFHMC17");//员工标识。员工编码
        //按号码地市//对于省集中的省份,如果需要办理业务中没有用户号码,必须填写该字段具体地州编码值
        parames.put("routeeparchycode",mobile.getCityCode());
        //parames.put("TRADEDEPARTPASSWD","BR2020080715903");//渠道接入密码
        //parames.put("appKey","");//应用秘钥(走能力开放的渠道需传入,走服务总线的不需要传)密码由能力开放分配
        return parames;
    }

    /**
      * 加密方法
      * 
      * @param date
      * @return
      */
    public String encryp(String reqStr) throws Exception {
        String enpw = AccountPasswordUtil.encrypt(reqStr);
        System.out.println("_enpw=" + enpw);
        return enpw;
    }


    /**
      * 解密方法
      * 
      * @param date
      * @return
      */
    public String decryp(String responseTemp) throws Exception {
        // logger.debug("加密之后" +_enpw);
        String _unexpw = AccountPasswordUtil.decryption(responseTemp);
        // logger.debug("加密  之后  自我解密" +_enpw);
        System.out.println("_unexpw=" + _unexpw);
        return _unexpw;
    }

    public static void main(String[] args) throws Exception {
        //System.out.println(decryp("16c9ecdd4393a7b0eab6dd13fe3b45c9b1a1ced26fdb45255299e2e3ad76d5484683147511f0609734b5f177efcc39c971a8b232c4976cacb14042c8a46187b51944f79c79af44fc7fbd72ad864dd86add329c5ecf54c145aaed4f48a386f44877bdab14cbb5065292a961909be753122f7ff5a48f27089e01898f231804bb7ac0e4f77b611833c7e03ddc99f483e7df4b29864dd6e7b58e4a26ba4ad6eceb8f2b1419de1a6c9af30a380a09c8855f31b402f2b93d41a8508ca3e975baeaeb70b2e2683e62bb66e366ec502ab9dfebe05e225fe7b52abb00927c80e54fcd8cf79c9118d3f4efb736bb50d5a89d6970e8d01e43573102010753017284967e8b12ea6b14dc2b9142e41953cb7a5fc93a270718bb1fe7c1524688c7b79af52b68c06e8a8aa679378d6d83850dfcf283e48aaf0d1bb15fcb1cd4b82a53cb4831a9711899b01cd880c775763c083ce45cffb08cbc04819f71dae787888e1f155f1c65ec9a8e1eca907ef2ec50ee486d8703bf4fac54045ddee00b4ef0ff3e6f7a0aa6ef9ce834c0878e9c62bd52b08358922b10a114f5738bd167475077120bea00575330e2410f3de8ececc14462f0aabb4446bbd265ef4dfb3ccca161543d2b95876d2274880839a567f9a124fdd27b577b238bab5b9e0cfb12d0ce32aff41e17f795eb158c7f0e73d42125abb76e2c89f9ffa3115bd6d8fa694b046dd17f8ace266fa5bfa8ce5d2e71585afd35e209827b1b0e7013c2e4a90a0d20f5fd5de9abdb3b14e6950a06374ccefce9b4bb5046a4502a8815eebb9785a920a16eda0511b9fdded5fdada57b33bcff84ba055975ba44fe51c5f9d7c4199a2983adb5fe6860a3ddbf9543d28a13e9c24056218969b0faf806f350dce98ab5222325fade6050ced7daaf9abc40c62997e9a2ae15068357dfccbbc2186cf6399978fbddc02051e6d919a0a15f9455432f2e5347e675b46bc38c4020c226ec403be2ac857872f671a366fd7a76af08d10e345938fb1d6bc3e92abefe6cd36b5e436f4e050eee9cfd437cdb2f12a0625d48620085367eee833619260708859d93ab1dbfead817395567f61c31f826eccd7de38841917b1fe9c984b75fa1b123714771eb06df2b401f95798612a204ac4ec036fbd04fe1687e59c91e041e4300a151ea4a36a2f01beef99148eb023047fe568510448a45a72fd472f1eec71dacb48e86fb0deaf4510b0e02fa73a8d857686dc5a84b6a92b00d20f5fd5de9abdbd08bd2c245f8f02737c2f17470ee13b27d80178855ee58e1"));

//        final Mobile mobile = null;// mobileService.findPhone(order.getUpphonenum().substring(0, 7));
//        JSONObject publicParamters = new QingHaiYd().publicParamters("QHAI_UNHQ_queryGrpTransInfoByGrpId","appId",
//                "orderId","provincecode","upKey",mobile);
//        LinkedHashMap<String,String> content = new LinkedHashMap<>();
//        content.put("GROUP_ID","appId");//集团客户编码
//        publicParamters.put("content",JSONObject.toJSONString(content));
//        System.out.println(JSONObject.toJSONString(publicParamters));
//       String xx = "http://111.44.229.249:7019/oppf?method=QHAI_UNHQ_checkCustManager&Status=1&appId=7100047372&flowId=2c922ab774daa4de0174daaa3b3c0123&format=json&inmodecode=k&provincecode=QHAI&staffid=ITFHMC17&timestamp=20200930002023&tradecitycode=INTF&tradedepartid=BR2020080715903&tradeeparchycode=0971&content={\"SERIAL_NUMBER\":\"13446970000\",\"GROUP_ID\":\"7100047372\"}";
//

    }
}
